define([] , function(){
	return function( app ){
		app.controller('AppCtrl' , function( $scope , $ajax , $timeout  ){
			console.log('这里调用了appcontroller;ROOT') ;
			var handler = {
				init 	: 	function(){
					var _this = this ;
					$('#logout-btn').on('click' , function(){
						_this.logout() ;
					});
					return this.getUserSession() ;
				},
				logout 			: 	function(){
					confirm('是否退出系统?' , function(){

					});
				},
				getUserSession : function() {
					/*$ajax.get('sys/user/session').success( function( result ){
						if( result.code != 0 )
							return layui.layer.msg( result.message ) ;
						$scope.session = {
							user 	: 	result.data
						}
					});*/
					var user = {
						username 	: 	'系统管理员' ,
						roleName 	: 	'系统管理员' ,
						avatar 		: 	'http://adminex.themebucket.net/images/photos/user-avatar.png'
					}
					$timeout( function(){
						$scope.session = user ;
					});
					return this ;
				}
			}.init() ;
		});
	}
});